import { Modal } from '@arco-design/web-vue';
import type { ModalConfig } from '@arco-design/web-vue/es/modal/interface';
import './style.scss'


/**
 * 使用消息提示
 * @param type
 * @param config
 */
export function useMessageConfirm(type: 'info' | 'error' | 'warning', config: ModalConfig) {
	config = {
		modalStyle: {
			top: '-25%',
		},
		modalClass:'modal-type__confirm',
		hideCancel: false,
		title: '系统提示',
		titleAlign: 'start',
		okText: '确认',
		cancelText: '取消',
		bodyStyle: {
			textAlign: 'center',
		},
		okButtonProps: {
			status: type === 'error' ? 'danger' : type as any,
			disabled: false,
		},
		...config,
	};

	Modal[type](config);
}
